﻿using System;

namespace OBoobsWallpaper.Logic
{
    public class BException : Exception
    {
        public BException()
        {
        }

        public BException(string message, params object [] args)
            : base(string.Format(message, IfNullWrapWithArray(args)))
        {
        }

        public BException(Exception innerException, string message, params object[] args)
            : base(string.Format(message, IfNullWrapWithArray(args)), innerException)
        {
        }

        private static object [] IfNullWrapWithArray(params object[] args)
        {
            return args ?? new object[] {"<null>"};
        }
    }
}